﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//using Chefbook.DataObjects;

namespace Chefbook.HelperMethods
{
    public static class NullHandlingExtensionMethods
    {
        /// <summary>
        /// Performs an action if this is not null
        /// </summary>
        /// <param name="obj">The object to check for null</param>
        /// <param name="actionToPerform">The action to perform if this is not null</param>
        public static void PerformIfNotNull(this object valueToCheck, Action actionToPerform)
        {
            if (valueToCheck != null)
            {
                actionToPerform();
            }
        }
    }
}
